<include file="Admin@default/public/header" />
<div class="toptip">
    <div class="toptit">提示：</div>
    <p>你可以通过全选来设置所有页面的链接方式和缓存时间</p>
    <p>职位列表页，人才列表页，会员中心页面均不能开启缓存 </p>
    <p>系统内内置页面无法删除！ </p>
    <p>强烈建议开启页面缓存，缓存让系统性能显著提高！</p>
    <p class="link_green_line">骑士人才系统支持多种URL样式，无论您是asp , aspx , jsp ，shtml......程序都可以完美转换为骑士系统，且URL可以保持不变，具体请咨询<a href="http://www.74cms.com" target="_blank">骑士客服</a></p>
</div>
<notempty name="apply['Subsite']">
    <div class="seltpye_x">
        <div class="left">所属分站</div>
        <qscms:subsite 列表名="subsite_list"/>
        <div class="right">
        <if condition="$visitor['role_id'] eq 1">
            <volist name="subsite_list" id="subsite">
                <a href="{:P(array('subsite_id'=>$subsite['s_id']))}" <if condition="$Think.get.subsite_id eq $subsite['s_id'] or ($Think.get.subsite_id eq 0 and $subsite['s_id'] eq 0)">class="select"</if>>{$subsite.s_sitename}</a>
            </volist>
        <else/>
            <volist name="subsite_list" id="subsite">
                <if condition="in_array($subsite['s_id'],$visitor['subsite'])">
                    <a href="{:P(array('subsite_id'=>$subsite['s_id']))}" <if condition="$Think.get.subsite_id eq $subsite['s_id']">class="select"</if>>{$subsite.s_sitename}</a>
                </if>
            </volist>
        </if>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
</notempty>
<form action="{:U('set_url')}" method="post" name="form1" id="form1">
    <div class="list_th">
        <div class="td" style=" width:30%;">
            <label id="chkAll" class="left_padding">
                <input type="checkbox" name="chkAll" id="chk" title="全选/反选"/>页面名称
            </label>
        </div>
        <div class="td" style=" width:30%;">调用名</div>
        <div class="td center" style=" width:10%;">类型</div>
        <div class="td center" style=" width:10%;">链接</div>
        <div class="td center" style=" width:10%;">缓存</div>
        <div class="td" style=" width:10%;">编辑</div>
        <div class="clear"></div>
    </div>
    <volist name="list" id="vo">
        <div class="list_tr link_black">
            <div class="td" style=" width:30%;">
                <div class="left_padding striking">
                    <input name="id[]" type="checkbox" id="id" value="{$vo['id']}"/>{$vo['pname']}
                </div>
            </div>
            <div class="td" style=" width:30%;">{$vo['alias']}</div>
            <div class="td center" style=" width:10%;">
                <if condition="$vo['systemclass'] eq 1"><span style="color: #FF6600">系统内置</span><else />自定义页面</if>
            </div>
            <div class="td center" style=" width:10%;">
                <if condition="$vo['url'] eq 0">原始链接</if>
                <if condition="$vo['url'] eq 1">伪静态</if>
            </div>
            <div class="td center" style=" width:10%;">
                <if condition="$vo['caching'] eq 0"><span style="color:#999999">已关闭</span><else /><em>{$vo['caching']}</em> 分</if>
            </div>
            <div class="td edit" style=" width:10%;">
                <a href="{:U('page_edit',array('id'=>$vo['id']))}">修改</a>
                <if condition="$vo['systemclass'] neq 1">
                    <a href="{:U('page_delete',array('id'=>$vo['id']))}" class="gray" onclick="return confirm('你确定要删除吗？')">删除</a>
                </if>
            </div>
        </div>
    </volist>
</form>
<empty name="list">
    <div class="list_empty">没有任何信息！</div>
</empty>
<div class="list_foot">
    <div class="btnbox">
        <input type="button" value="添加页面" class="admin_submit" id="add" onclick="window.location='{:U('page_add')}'"/>
        <input type="button" value="设置链接" class="admin_submit" id="SetUrl"/>
        <input type="button" value="设置缓存" class="admin_submit" id="SetCaching"/>
        <input type="button" value="删除页面" class="admin_submit" id="ButDel"/>
    </div>
</div>
<div class="pages">{$page}</div>
</div>
  <!--弹出层的内容-->
<div id="UrlHtml" style="display: none" >
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="6" >
    <tr>
      <td width="20" height="30">&nbsp;</td>
      <td height="30"><strong  style="color:#0066CC; font-size:14px;">将所选页面链接设置为：</strong></td>
    </tr>
        <tr>
      <td height="25">&nbsp;</td>
      <td>
    <label >
                      <input name="url" type="radio" value="0" checked="checked"  />
                      原始链接 </label>   </td>
    </tr>
    <tr>
      <td height="25">&nbsp;</td>
      <td><label >
                      <input type="radio" name="url" value="1"  />
                      伪静态</label></td>
    </tr>

    <tr>
      <td height="25">&nbsp;</td>
      <td><input type="submit" name="set_url" id="set_url" value="确定" class="admin_submit"    /></td>
      </tr>
  </table>
</div>
<!--弹出层的内容结束--> 
<div id="CachingHtml" style="display: none" >
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="6" >
    <tr>
      <td height="30">&nbsp;</td>
      <td height="30"><strong  style="color:#0066CC; font-size:14px;">将所选页面缓存设置为：</strong></td>
    </tr>
        <tr>
      <td width="20" height="25">&nbsp;</td>
      <td>
   <input name="caching" type="text"  class="input_text_200" id="caching" value="0" maxlength="30"/>

            分钟 <br /><br />

      <span style="color:#666666">(0为不缓存,建议设为180 以上) </span></td>
    </tr>
 
        <tr>
          <td height="25">&nbsp;</td>
          <td><input type="button" name="set_caching" id="set_caching" value="确定" class="admin_submit"></td>
    </tr>
  </table>
</div>
<!--弹出层的内容结束-->
<include file="Admin@default/public/footer" />
<script type="text/javascript">
$(document).ready(function() {
    //设置url
    $("#SetUrl").click(function () {
        var data = $("form[name=form1]").serialize();
        if(data.length == 0){
            disapperTooltip('remind','请选择页面！');
        } else {
            var qsDialog = $(this).dialog({
                title: '设置链接',
                loading: true,
                footer : false
            });
            var url = "{:U('ajax_set_url')}";
            $.post(url, data, function (result) {
                if(result.status == 1){
                    qsDialog.setContent(result.data);
                } else {
                    qsDialog.hide();
                    disapperTooltip('remind',result.msg);
                }
            });
        }
    });
    //设置缓存
    $("#SetCaching").click(function () {
        var data = $("form[name=form1]").serialize();
        if(data.length == 0){
            disapperTooltip('remind','请选择页面！');
        } else {
            var qsDialog = $(this).dialog({
                title: '设置缓存时长',
                loading: true,
                footer : false
            });
            var url = "{:U('ajax_set_cache')}";
            $.post(url, data, function (result) {
                if(result.status == 1){
                    qsDialog.setContent(result.data);
                } else {
                    qsDialog.hide();
                    disapperTooltip('remind',result.msg);
                }
            });
        }
    });
    //点击批量删除
    $("#ButDel").click(function(){
        var data = $("form[name=form1]").serialize();
        if(data.length == 0){
            disapperTooltip('remind','请选择页面！');
        } else {
            if (confirm('你确定要删除吗？'))
            {
                $("form[name=form1]").attr("action","{:U('page_delete')}");
                $("form[name=form1]").submit()
            }
        }
    });

});
</script>
</body>
</html>